home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 3006 / 3006.xpi / chrome / dwhelper.jar / content / twitter-message.xul < prev    next >
Extensible Markup Language  |  2010-01-15  |  2KB  |  58 lines

  1. <?xml version="1.0"?> 
  2. <!-- *****************************************************************************
  3.  *            Copyright (c) 2006-2009 Michel Gutierrez. All Rights Reserved.
  4.  ****************************************************************************** -->
  5. <?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
  6. <?xml-stylesheet href="chrome://dwhelper/content/bindings.css" type="text/css"?>
  7.  
  8. <!DOCTYPE dialog SYSTEM "chrome://dwhelper/locale/dwhelper.dtd" >
  9.  
  10. <dialog id="dwhelper-twitter-message"
  11.         title="&twitter.title.send-message;"
  12.         flex="1"
  13.         onload="onLoad()"
  14.         ondialogaccept="return onOk()"
  15.         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  16.         xmlns:html="http://www.w3.org/1999/xhtml"
  17.         buttons="cancel,accept">
  18.         
  19.     <html:style>
  20.     </html:style>
  21.  
  22.     <script><![CDATA[
  23. var Util=Components.classes["@downloadhelper.net/util-service;1"]
  24.     .getService(Components.interfaces.dhIUtilService);
  25.  
  26. function onLoad() {
  27.     var data=window.arguments[0];
  28.     var tm=document.getElementById("twitter-message");
  29.     tm.value=data.message;
  30.     tm.user=data.user;
  31.     tm.smartNaming=data.smartnaming;
  32.     windows.sizeToContent();
  33. }
  34.  
  35. function onOk() {
  36.     var data=window.arguments[0];
  37.     var tm=document.getElementById("twitter-message");
  38.     if(tm.value.indexOf(data.url)<0) {
  39.         Util.alertError(Util.getText("twitter.message.url-not-found"));
  40.         return false;
  41.     }
  42.     var twitter=Components.classes['@downloadhelper.net/twitter-processor;1'].
  43.         getService(Components.interfaces.dhITwitter);
  44.     if(twitter.twitterLength(tm.value)>140) {
  45.         Util.alertError(Util.getText("twitter.message.too-long"));
  46.         return false;
  47.     }
  48.     twitter.update(tm.value);
  49.     return true;
  50. }
  51.  
  52. ]]>
  53.     </script>
  54.  
  55.     <TwitterMessage id="twitter-message" flex="1"/>
  56.  
  57. </dialog>
  58.